package leo.data
{
	import flash.display.BitmapData;
	import flash.utils.Dictionary;
	
	import leo.manager.BitmapManager;
	/**
	 * 防守塔数据 
	 * @author leo
	 * 
	 */
	public class TowerVO
	{
		/**
		 * 攻击力 
		 */		
		public var attack :int;
		/**
		 * 攻击范围 
		 */		
		public var attRange :int;
		/**
		 * 攻击速度 
		 */		
		public var attSpeed :int;
		/**
		 * 子弹速度 
		 */		
		public var bulletSpeed :int;
		/**
		 * 塔类型 
		 */		
		public var type :int;
		/**
		 * 防守塔价格 
		 */		
		public var price :int;
		/**
		 * 塔ID，同swf链接名
		 */		
		public var id :String;
		/**
		 * 名字 
		 */		
		public var name :String;
		/**
		 * 攻击目标数 
		 */		
		public var attTargetNum :int;
		/**
		 * 素材表 
		 */		
		public var imgDict :Dictionary;
		/**
		 * 防守塔的描述 
		 */		
		public var describe :String;
		/**
		 * 图片信息
		 */
		private var _bitmapData :BitmapData;
		
		public function TowerVO()
		{
		}
		/**
		 * 创建防守塔VO 
		 * @param obj
		 * 
		 */		
		public static function create(obj :Object):void
		{
			var towerVOList :Vector.<TowerVO> = GameModel.instance.towerVOList;
			var towerVO :TowerVO = new TowerVO();
			towerVO.describe = obj.@describe;
			towerVO.attack = obj.@attack;
			towerVO.attRange = obj.@attRange;
			towerVO.attSpeed = obj.@attSpeed;
			towerVO.id = obj.@id;
			towerVO.type = obj.@type;
			towerVO.name = obj.@name;
			towerVO.bulletSpeed = obj.@bulletSpeed;
			towerVO.attTargetNum = obj.@attTargetNum;
			towerVO.price = obj.@price;
			towerVOList.push(towerVO);
		}

		/**
		 * 图片信息
		 */
		public function get bitmapData():BitmapData
		{
			return BitmapManager.instance.getBitmapdataByName(this.id);
		}

		
	}
}